<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<ReportSummary> list = (List<ReportSummary>)request.getAttribute("list");
	ReportForm form = (ReportForm)request.getAttribute("command");
%>
<div class="main">
	<div class="oaTable">
<table class="tableList">

	<thead>
		<tr>
			<td colspan="13" style="width: 100%;">
				<div class="FormTools">
					<div>工号：
						<input id="userid" type="text" name="userid" class="search" value="<%=StringUtils.isNotBlank(form.getUserid())?form.getUserid():""%>"
							placeholder="请输入员工编号"/>
						<input type="button" class="searchSubmit" onclick="javascript:XF.Check.summaryListSearch()" value="搜索"/>
					</div>
					<div>部门：
						<select id="deptList" class="easyui-combobox" name="deptid" style="width:100px;"></select>
					</div>					
					<div>所属公司：
						<select id="siteList" class="easyui-combobox" name="siteid" style="width:100px;"></select>
					</div>
					<div>
						月份：
						<input style="width: 100px;" type="text" value="<%=form.getMonth() %>" name="month" onClick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM',maxDate:'%y-%M'})">
					</div>
				</div>
			</td>
		</tr>
	</thead>

	<tbody>
		<tr id="tableHeader">
			<th style="width: 6%">工号</th>
			<th style="width: 6%">姓名</th>
			<th style="width: 5%">部门</th>
			<th style="width: 5%">所属公司</th>
			<th style="width: 8%">应勤天数</th>
			<th style="width: 10%">实勤天数</th>
			<th style="width: 10%">旷工天数</th>
			<th style="width: 5%">请假天数</th>
			<th style="width: 5%">假日天数</th>
			<th style="width: 5%">迟到次数</th>
			<th style="width: 5%">迟到分钟</th>
			<th style="width: 5%">早退次数</th>
			<th style="width: 5%">早退分钟</th>
		</tr>
				<%
			if (list != null && list.size() > 0) {
				for (ReportSummary summary: list) {
		%>
						<tr>
							<td><%=summary.getUserid()!=null?summary.getUserid():"" %></td>
							<td><%=summary.getUsername()!=null?summary.getUsername():""  %></td>
							<td><%=summary.getDeptname()!=null?summary.getDeptname():"" %></td>
							<td><%=summary.getSitename()!=null?summary.getSitename():""  %></td>
							<td><%=summary.getShouldday()  %></td>
							<td><%=summary.getRealday()%></td>
							<td><%=summary.getOffworkday()  %></td>
							<td><%=summary.getLeaveday() %></td>
							<td><%=summary.getHoliday() %></td>
							<td><%=summary.getLatenum() %></td>
							<td><%=summary.getLatemin() %></td>
							<td><%=summary.getEarlynum() %></td>
							<td><%=summary.getEarlymin()%></td>
						</tr>
					<%
				}
			}
		
		%>

	</tbody>
</table>
</div>
</div>
<script>
$('#siteList').combobox({
	url:global.contextPath + '/company/siteList',
	valueField:'siteid',
	textField:'sitename',
});
$('#deptList').combobox({
	url:global.contextPath + '/company/deptList',
	valueField:'dictid',
	textField:'dictname',
});
$('#siteList').combobox('setValue', '<%=form.getSiteid() %>');
$('#deptList').combobox('setValue', '<%=form.getDeptid() %>');
</script>